//551.学生出勤记录I
//https://leetcode.cn/problems/student-attendance-record-i/
class Solution {
public:
    bool checkRecord(string s) {
        bool La = true; //迟到
        int Ab = 0;     //缺勤
        int n = s.size();
        for(int i = 0;i<n;++i)
        {
            if(s[i] == 'A') ++Ab;
            else if(i-1>=0 && i+1<n && s[i-1]==s[i] && s[i] == s[i+1] && s[i] == 'L') La = false;
        }
        return La && Ab<2;
    }
};